<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@page import="iwpl.project.dao.AccountsDAO"%>
<%@page import="iwpl.project.entities.Accounts"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Accounts acc1 =(Accounts)session.getAttribute("alogin");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'Account_Infomation.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <form name="frmInsertAccount"  action="./servlet/Control_Account"
				method="get">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td>

							
							<%
							
								//Integer id = (Integer)session.getAttribute("sid");
								Integer id=0;
								String sAid ="";
								String sEmployee="";
								String sRole="";
								String sUsername="";
								String sDisc="";
								int sActive= 0;
								AccountsDAO acc = new AccountsDAO();
								Accounts data = null;
								if(acc1!=null)
								{
									data = acc1;
									sAid = data.getId().toString();
									sEmployee = data.getEmployees().getFullName();
									sRole = data.getRoles().getRoleName();
									sUsername = data.getUserName();
									sDisc = data.getActive().toString();
									id=data.getId();
									
									if(data.getActive())
            						{
				            			sActive = 1;
				            		}
				            		else
				            		{
				            			sActive = 0;
				            		}
								}
							%>
							<table>
								<tr>
									<td colspan="3" align="center">
										<h1>
											Account
										</h1>
									</td>
								</tr>
								<tr>
									<td>
										EmployeeName:
									</td>
									<td colspan="2">
										<input type="hidden" name="aid" value="<%=sAid%>" />
										
										<input type="text" readonly="readonly" value="<%=sEmployee%>" name="txtEmployeeName" />
									</td>
									
								</tr>
								<tr>

									<td>
										RoleName:
									</td>
									<td colspan="2">
										<input type="text" readonly="readonly" value="<%=sRole %>" name="TxtroleName" />
									</td>
								</tr>
								<tr>
									<td>
										UseName:
									</td>
									<td colspan="2">
										<input type="text" name="txtUserName" readonly="readonly" value=<%=sUsername%> />
									</td>
								</tr>
								<tr>
									<td>
										Active:
									</td>
									<td colspan="2">
										
										<%
										if (sActive == 1) 
										{
												out.println("<input type=\"checkbox\" name=\"chkActive\"");
												out.println("checked=\"checked\" />");
											} else {
												out.println("<input type=\"checkbox\" readonly=\"readonly\"  name=\"chkActive\" />");
											}
										%>
										
										
										
										
									</td>
								</tr>
								
								
								<tr>
									
									<td colspan="3">
										<input type="button" name="btnCancel" value="Change pass" onClick="self.location='ChangePassword.jsp'" />
										<input type="button" name ="btnCancel" value="Cancel" onClick="self.location='index.jsp'" />
								
									</td>
								</tr>
							</table>

						</td>
					</tr>
				</table>
			</form>
  </body>
</html>
